import React, {PureComponent} from "react";
import {connect} from "react-redux";
import Detail from "components/ProjectList/Detail"
import {callApi} from 'app/utils'
export default class extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {
        detail:{},
        opt:{
          page:1,
          pageSize:10,
        },
        investrecord:{},
        profile:{}
      }
    };
  

  componentDidMount() {
   
    
    callApi("/loan/profile/new", {loanId: this.props.params.id}, "POST","").then(data => {
      this.setState({ detail:data.data })
    })
   
    callApi("/loan/profile", {loanId: this.props.params.id}, "POST","").then(data => {
      this.setState({ profile:data.data })
    })
      
  }

  

  render() {
   let id = this.props.params.id
   let {detail,profile} = this.state
    return (
    <Detail
      detail={detail}
      profile={profile}
      props={this.props}
    />
  )
  }
}